import * as types from '../types'

const reducer = (state = {
    count: 100
}, action) => {
    switch (action.type) {
        case types.ADD:

            return { ...state, count: state.count + 1 }

        case types.REDUCE:

            return { ...state, count: state.count - action.payload }
        default:
            return state
    }
}


export default reducer